/*

	Write the oneShapePrintReverse method.  Your solution must utilize recursion
	for credit.  Note that ShapeList is a sub-class of LinkedList2 that does a Shape
	specific operation, so it is permissible (and necessary) for it to examine
	the data in a given Node and *treat it as a Shape*.

	It is permissible to use a helper method that does the actual recursion.

	If the list is empty on print, the message "List empty on oneShapePrintReverse"
	should be printed.

	For your convenience on this problem the Shape class has a
	*getName* method you can call.
*/

public class ShapeList /*ans bl*/extends LinkedList2/*ans ab*/
{
/*ans bl*/
	public void oneShapePrintReverse(String shape)
	{
		if (isEmpty())
			System.out.println("List empty on oneShapePrintReverse");
		else
			oneShapePrintReverse(shape, _head);


	}

	private void oneShapePrintReverse(String shape, Node cur)
	{
		if (cur != null)
		{
			oneShapePrintReverse(shape, cur._next);
			if (((Shape)cur._data).getName().compareTo(shape) == 0)
				System.out.println(cur._data);

		}

	}
/*ans ab*/



}//end class ShapeList